﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="废品判定通知书管理.aspx.cs" Inherits="syc.ZhiJian.废品判定通知书管理" %>

<html >
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script> 
<form id="form1" runat="server">
<asp:Label ID="SqlText" runat="server" Text="" Visible="false"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
SelectCommand="select 0 as ID,'全部' as 名称 union select ID,名称 FROM 原料供货单位"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"
onselected="SqlDataSource1_Selected" 
>
<DeleteParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4" />
</DeleteParameters>
</asp:SqlDataSource>
<div id="wintop" class="wintop">废品判定通知书管理</div>
<asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="记录查询">
年份：<asp:DropDownList ID="Year" runat="server" AutoPostBack="true">   
            <asp:ListItem Text="全部" Value="0"></asp:ListItem>    
            <asp:ListItem>2010</asp:ListItem>
            <asp:ListItem>2011</asp:ListItem>
            <asp:ListItem>2012</asp:ListItem>
            <asp:ListItem>2013</asp:ListItem>
            <asp:ListItem>2014</asp:ListItem>
            <asp:ListItem>2015</asp:ListItem>   
            <asp:ListItem>2016</asp:ListItem>
            <asp:ListItem>2017</asp:ListItem>          
            </asp:DropDownList>
月份：<asp:DropDownList ID="Month" runat="server"  AutoPostBack="true">
                <asp:ListItem Text="全部" Value="0"></asp:ListItem>  
                <asp:ListItem>1</asp:ListItem>
                <asp:ListItem>2</asp:ListItem>
                <asp:ListItem>3</asp:ListItem>
                <asp:ListItem>4</asp:ListItem>
                <asp:ListItem>5</asp:ListItem>
                <asp:ListItem>6</asp:ListItem>
                <asp:ListItem>7</asp:ListItem>
                <asp:ListItem>8</asp:ListItem>
                <asp:ListItem>9</asp:ListItem>
                <asp:ListItem>10</asp:ListItem>
                <asp:ListItem>11</asp:ListItem>
                <asp:ListItem>12</asp:ListItem>
            </asp:DropDownList>
    <span style="margin-left:22px;">
    品名：<asp:DropDownList ID="LeiBie" 
        runat="server" Font-Size="14px" Width="120">
        <asp:ListItem Text="全部" Value="0"></asp:ListItem>
        <asp:ListItem Text="油管接箍(J55)" Value="1"></asp:ListItem>
        <asp:ListItem Text="套管接箍(J55)" Value="2"></asp:ListItem>
        <asp:ListItem Text="油管接箍(N80)" Value="3"></asp:ListItem>
        <asp:ListItem Text="套管接箍(N80)" Value="4"></asp:ListItem>
    </asp:DropDownList>
    <br />
    供货单位：<asp:DropDownList ID="GongHuo" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID" 
        Font-Size="14px" Width="120">
    </asp:DropDownList>
    <span style="margin-left:5px;">
    废品类型：<asp:DropDownList ID="LeiXing" 
        runat="server" Font-Size="14px" Width="120">
        <asp:ListItem Text="磁粉探伤" Value="1"></asp:ListItem>
        <asp:ListItem Text="车丝" Value="2"></asp:ListItem>
    </asp:DropDownList>   
     
    <span style="margin-left:28px;">
    <asp:Button ID="Button_Query" runat="server" CssClass="mbutton" 
        onclick="Button_Query_Click" Text="查 询" UseSubmitBehavior="false" />
    <asp:Button ID="Button_Reset" runat="server" CssClass="mbutton" 
        onclick="Button_Reset_Click" Text="清空条件" UseSubmitBehavior="false" />
    </span></span></asp:Panel>
    <asp:Panel ID="Panel4" runat="server" CssClass="panel2">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
    
  <div class="gridframe">
    <div class="gridview">
    
        <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
            <tr>
		           <td class="grid-title"><div style="float:left;margin-top:3px;">废品判定通知书管理</div><div style="float:right;">
                    <asp:DropDownList ID="PageSizeOption" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="PageSizeOption_SelectedIndexChanged">
                    <asp:ListItem Value="10" >10 项/页</asp:ListItem>
                    <asp:ListItem Value="20" Selected="True">20 项/页</asp:ListItem>
                    <asp:ListItem Value="30">30 项/页</asp:ListItem>
                    <asp:ListItem Value="50">50 项/页</asp:ListItem>
                    <asp:ListItem Value="100">100 项/页</asp:ListItem>
                    </asp:DropDownList></div>
	            </td>		          
		        </tr>           
	        <tr>
	            <td class="grid-back">        
                  <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" CssClass="grid" DataKeyNames="" 
                        DataSourceID="SqlDataSource1"
                        PageSize="10"
                        GridLines="None" ondatabound="GridView1_DataBound" 
                        onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                        UseAccessibleHeader="False" 
                        onselectedindexchanged="GridView1_SelectedIndexChanged">
                        <PagerSettings Visible="False" />
                        <RowStyle CssClass="grid-row-normal" />
                        <Columns>                        
                            <asp:TemplateField HeaderText="">
                            <ItemTemplate>
                                <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                        </asp:TemplateField>   
                        <asp:TemplateField HeaderText="年度" >
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("年度") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>  
                        <asp:TemplateField HeaderText="月份" >
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("月份") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>                        
                         <asp:TemplateField HeaderText="供货单位" >
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Bind("供货单位") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                        </asp:TemplateField>                        
                        
                        <asp:TemplateField HeaderText="接箍类别" >
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%# Bind("品名") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                        </asp:TemplateField>
                        
                         <asp:TemplateField HeaderText="炉号" >
                            <ItemTemplate>
                                <asp:Label ID="Label9" runat="server" Text='<%# Bind("炉号") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="废品支数">
                            <ItemTemplate>
                                <asp:Label ID="Label6" runat="server" Text='<%# Eval("废品支数") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="60px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="不合格原因">
                            <ItemTemplate>
                                <asp:Label ID="Label7" runat="server" Text='<%# Eval("原因") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>                      
                                 
                        <asp:TemplateField HeaderText="产品ID" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="Label11" runat="server" Text='<%# Eval("产品类别ID") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="grid-header" />
                            <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                        </asp:TemplateField>                          
                        <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                            <input id="mxbu" type="button" value="明细" class="smallbutton" onclick="parent.swin2_load('/zhijian/废品判定通知书.aspx?pm=<%#Eval("产品类别ID") %>&&zs=<%#Eval("废品支数") %>&&ghs=<%#Eval("供货单位") %>&&lh=<%#Eval("炉号") %>&&yy=<%# Eval("原因")%>',820,600,'yes');" />
                                    </ItemTemplate>
                        </asp:TemplateField>                                               
                        </Columns>
                        <SelectedRowStyle CssClass="grid-row-selected" />
                      </asp:GridView>                    
                      
                      
                   
	            </td>
            </tr>
            <tr>
	            <td>   
	                <table width="100%">
	                    <tr>
	                        <td class="pagebar">
                                <asp:Button ID="Button_Pager_First" UseSubmitBehavior="false" runat="server" Text="" ToolTip="首页" 
                                    CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                <asp:Button ID="Button_Pager_Prev" UseSubmitBehavior="false" runat="server" Text="" ToolTip="上一页" 
                                    CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                <input type="button" class="page-split" UseSubmitBehavior="false" disabled />第<asp:TextBox 
                                    ID="TextBox_Pager" AutoPostBack="True" runat="server" CssClass="pageturn" 
                                    ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" disabled /><asp:Label ID="Label_Pages" UseSubmitBehavior="false" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                                
                                <asp:Button ID="Button_Pager_Next" UseSubmitBehavior="false" runat="server" Text="" ToolTip="下一页" 
                                    CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                <asp:Button ID="Button_Pager_Last" UseSubmitBehavior="false" runat="server" Text="" ToolTip="末页" 
                                    CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" /><asp:Label ID="Label9" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                            </td>
                            <td class="pagebar" align="right">
                                <asp:Label ID="Label_Total" runat="server"></asp:Label>
                            </td>
                        </tr>
                   </table>

	            </td>
            </tr>
        </table>
        

    </div>
</div>

</form>
<script>
    var notice = '<%=this.Notice %>';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            //textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = selectRow;
        }
    }
    document.onkeydown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName == "INPUT" && tag.className == "textbox" || tag.tagName == "SELECT") {
            if (e.keyCode == 13) e.keyCode = 9;
        }
    }

    var rows = document.getElementById("GridView1").rows;
    var sum1 = 0;
    var n1;
    for (i = 1; i < rows.length; i++) {
        n1 = Number(rows[i].cells[6].innerText);
       
        if (n1 >= 0) {
            sum1 += n1;       
        }       
    }
    var total = document.getElementById("Label_Total");
    total.innerHTML += "　　本页小计：" + (rows.length - 1) + " 项 废品支数：" + sum1 + "支 ";

</script>
</body>
</html>

